package com.chenxi.clouduidemo;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SpringCloudApplication
@Controller
public class CloudUiDemoApplication extends WebMvcConfigurerAdapter{

	@RequestMapping(value = "/index")
	public ModelAndView index(){
		System.out.println("ssssssssssss");
		return new ModelAndView("index");
	}

	public static void main(String[] args) {
		SpringApplication.run(CloudUiDemoApplication.class, args);
	}

	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/").setViewName("index");
	}
}
